﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Inaction.Core;
using Inaction.Mapping;

namespace Inaction.Business.Security.Abstract
{
    [Table("AssemblyClassResourceRole"), DisplayName("程序集类资源角色"), Serializable]
    public abstract class AssemblyClassResourceRole<T> : Inaction.Business.Entity<T> where T : AssemblyClassResourceRole<T>, new()
    {
        #region 属性

        public static readonly Property<Guid?> IdProperty = RegisteProperty<Guid?>(p => p.Id);
        Guid? _id;
        [Column("Id"), DisplayName("程序集类资源角色"), Display(Description = "程序集类资源角色")]
        public Guid? Id
        {
            get { return _id; }
            internal set { SetProperty(IdProperty, ref _id, value); }
        }

        public static readonly Property<Guid?> AssemblyClassReourceIdProperty = RegisteProperty<Guid?>(p => p.AssemblyClassReourceId);
        Guid? _assemblyClassReourceId;
        [Column("AssemblyClassReourceId"), DisplayName("程序集类资源"), Display(Description = "程序集类资源")]
        public Guid? AssemblyClassReourceId
        {
            get { return _assemblyClassReourceId; }
            set { SetProperty(AssemblyClassReourceIdProperty, ref _assemblyClassReourceId, value); }
        }

        public static readonly Property<Guid?> RoleIdProperty = RegisteProperty<Guid?>(p => p.RoleId);
        Guid? _roleId;
        [Column("RoleId"), DisplayName("角色"), Display(Description = "角色")]
        public Guid? RoleId
        {
            get { return _roleId; }
            set { SetProperty(RoleIdProperty, ref _roleId, value); }
        }

        public static readonly Property<Boolean?> AllowGetProperty = RegisteProperty<Boolean?>(p => p.AllowGet);
        Boolean? _allowGet;
        [Column("AllowGet"), DisplayName("是否可读"), Display(Description = "是否可读")]
        public Boolean? AllowGet
        {
            get { return _allowGet; }
            set { SetProperty(AllowGetProperty, ref _allowGet, value); }
        }

        public static readonly Property<Boolean?> AllowSetProperty = RegisteProperty<Boolean?>(p => p.AllowSet);
        Boolean? _allowSet;
        [Column("AllowSet"), DisplayName("是否可写"), Display(Description = "是否可写")]
        public Boolean? AllowSet
        {
            get { return _allowSet; }
            set { SetProperty(AllowSetProperty, ref _allowSet, value); }
        }

        public static readonly Property<Boolean?> AllowExecuteProperty = RegisteProperty<Boolean?>(p => p.AllowExecute);
        Boolean? _allowExecute;
        [Column("AllowExecute"), DisplayName("是否可执行"), Display(Description = "是否可执行")]
        public Boolean? AllowExecute
        {
            get { return _allowExecute; }
            set { SetProperty(AllowExecuteProperty, ref _allowExecute, value); }
        }


        #endregion
    }
}
